﻿using MiniFox.Platform.Web;
using MiniFox.Web.Infrastructure;

namespace MiniFox.Platform.Applications.Web
{
    /// <summary>
    /// 数据API
    /// </summary>
    [NoCache, PublicAccessible]
    public class DataController : DataControllerBase
    {
        DataSourceFactory _dataSourceFactory;
        /// <summary>
        /// 
        /// </summary>
        protected override DataSourceFactory Component
        {
            get
            {
                if (_dataSourceFactory == null)
                {
                    var authState = this.HttpContext.GetAuthState();
                    _dataSourceFactory = this.Container.GetComponent<DataSourceFactory>(authState);
                }
                return _dataSourceFactory;
            }
        }
    }
}
